import request from '@/utils/request'

// 定义基本的url
const BASE_URL = '/admin/system/sysDevicesUse';

export default {

    
    findAll(){
        return request({
          url:`${BASE_URL}/findAll`,
          method: 'get'
        })
      },


    // 列表 
    getDevicesUseList(page,limit,searchObj){
      return request({
          url: `${BASE_URL}/${page}/${limit}`,
          method: 'get',
          params: searchObj 
      })
    },


    // 【get = params,post = data】
    saveDevicesUse(DevicesUse) {
      return request({
          url: `${BASE_URL}/addDevicesUse`,  //addDevicesUse是对应后端@PostMapping("/addDevicesUse")
          method: 'post',   //传输方式，对应后端的提交表单方式
          data: DevicesUse   //传输数据 给后端
      })
  },

  // 根据id 去回显当前数据 
  getDevicesUseById(id) {
      return request({
          url: `${BASE_URL}/findDevicesUseById/${id}`,
          method: 'get'
      })
  },

  // 修改角色
  updateDevicesUse(DevicesUse) {
      return request({
          url: `${BASE_URL}/updateDevicesUse`,
          method: 'post',
          data: DevicesUse   //传输数据 给后端
      })
  },


  // 删除
  removeId(id) {
      return request({
          //  url: '/admin/system/DevicesUse/'+page+"/"+limit,
          url: `${BASE_URL}/removeDevicesUse/${id}`,
          method: 'delete', // 提交方式
      })
  },

  // 批量 删除
  batchremoveId(ids) {
      return request({
          url: `${BASE_URL}/removeDevicesUseByIds`,
          method: 'delete',  // 提交方式
          data: ids
      })
  },


}